var clientHeight = $(window).height() + 30;
var clientWidth = document.body.clientWidth;
$(function(){
    var kid = sessionStorage.getItem("kid");
    $('#affirm').click(function(){
        if($(this).html() == '查看'){
             window.location.href = $().AbsUrlParse("/web/page/indextwo");
            //  window.location.href = "index-two.html";
        } else {
            $('#qrcode').toggle(500);
        }
    })
    if(kid == "" || kid == null || kid == undefined){
        $('#success-later').hide();
        $('#share-page').show();
    } else {
        $('#success-later').show();
        $('#share-page').hide();
    }
    if(IsPC()){
         // 分享地址
        var qrcodeString = window.location.href;
        var qrcodeString = shareHost + 'web/page/share?kid=' + kid;
        // 在页面渲染分享二维码
        jQuery('#qrcode').qrcode({width: 140, height: 140, text: qrcodeString});
        $('.know').hide();
        $('.warning-back').hide();
        if(clientWidth > 1024){
            $('.success-img').css('width','30%');
        } else if(clientWidth > 768 && clientWidth < 1024){
            $('.success-img').css('width','50%');
        } else {
            $('.success-img').css('width','100%');
        }
        $('#affirm').html('分享');
        $('.share-img img').css('width','35%')
    }
    $('#share-page').css('height', clientHeight)
    $('.know').click(function(){
         $('.warning-back').hide();
         $(this).hide();
    })
})
